import {createStore} from 'redux';
import LoginReducer from './reducers/login-reducer';
import {persistStore, persistReducer} from 'redux-persist';
import AsyncStorage from '@react-native-async-storage/async-storage';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
const persistConfig = {
  key: 'root',
  storage: AsyncStorage,
  stateReconciler: autoMergeLevel2,
};

const myPersistReducer = persistReducer(persistConfig, LoginReducer);

const store = createStore(myPersistReducer);

export const persistor = persistStore(store);

export default store;